<template>
  <el-menu class="el-menu-vertical-demo"
           :default-openeds="['2']"
           style="min-height: 100%;overflow-x: hidden"
           :collapse="isCollapse"
           background-color="#304156"
           text-color="#fff"
           active-text-color="#ffd04b"
           :collapse-transition="false"
           router>
    <div style="height: 60px; line-height: 60px; text-align: center">
      <img src="../assets/logo.png" alt="" style="width: 20px; position: relative; top: 5px; margin-right: 5px">
      <b style="color: white" v-show="logoTextShow">学生信息管理系统</b>
    </div>
    <el-menu-item index="/home">
      <i class="el-icon-house"></i>
      <span slot="title">首页</span>
    </el-menu-item>
    <div  v-for="item in menuList" :key="item.id">
      <el-submenu :index="item.id + ''" >
        <template slot="title" >
          <i :class="item.icon"></i>
          <span slot="title" v-show="logoTextShow">{{ item.title }}</span>
        </template>
        <div  v-for="subItem in item.children" :key="subItem.id">
          <el-menu-item :index="subItem.path">
            <i :class="subItem.icon"></i>
            <span slot="title" >{{ subItem.title }}</span>
          </el-menu-item>
        </div>
      </el-submenu>
    </div>
  </el-menu>
</template>

<script>
export default {
  name: "Aside",
  props: {
    isCollapse: Boolean,
    logoTextShow: Boolean,
  },
  data() {
    return {
    }
  },
  computed:{
    menuList:{
      get(){
        return this.$store.state.menus.menuList
      }
    }
  },
}
</script>

<style scoped>

</style>